
<%@page import="com.wanmait.cookBook.vo.Cook"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="com.wanmait.cookBook.vo.Diary"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.wanmait.cookBook.vo.Pager"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%String path = request.getContextPath(); %>
    <script type="text/javascript" src="<%=path%>/front/js/jquery-3.5.0.min.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">


<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>爱下厨·日志列表</title>
<meta name="keywords" content="健康,美食天下健康,饮食健康,健康饮食,健康养生,健康生活" />
<meta name="description" content="" />
<meta name="renderer" content="webkit">
<link rel="shortcut icon" href="//static.meishichina.com/v6/img/lib/f.ico"/>
<link rel="apple-touch-icon" href="//static.meishichina.com/v6/img/lib/wapico.png" />
<link rel="stylesheet" type="text/css" href="//static.meishichina.com/v6/css/lib/all.css?v1=8">
<link rel="stylesheet" type="text/css" href="//static.meishichina.com/v6/css/lib/cms.css?v1=2018-10-09">
<script type="text/javascript" src="//static.meishichina.com/v6/js/lib/dfp-list-5.js"></script>
</head>
</head>
<body>
<div>
	<jsp:include page="/front/head.jsp"></jsp:include>
</div>
<div class="logo_wrap2" style="margin-top:-40px;">
<div class="logo_inner left">
<a href="" title="美食天下">美食天下</a>
</div>
<div class="logo_current left">
<h1><a href="" title="饮食健康">饮食健康</a></h1>
</div>


<!-- 搜索栏 -->
<div class="logo_search right" style="margin-left:2px;">

		<form method="post" action="<%=path%>/DiaryServlet?action=getAllDiary">
		<input type="submit"  title="搜索" class="search_Btn J_searchBTN right" id="">
		<input type="text" id="q" name="context"  class="search_Text J_searchTxt right">
		</form>

</div>
<!--搜索栏同行-->
<div class="logo_nav">
<a title="日志首页" class="on"  href="<%=path%>/DiaryServlet">日志首页<i></i><b></b></a>
<a title="话题" class=""  href="<%=path%>/TopicServlet">话题<i></i><b></b></a>
<a title="话题" class=""  href="<%=path%>/ShowAllCookServlet">菜谱<i></i><b></b></a>
</div>
</div>


<div class="nav_wrap2">
<ul>
<li><a href="<%=path %>/IndexServlet" title="首页">首页</a></li>
<li><a href="<%=path %>/ShowAllCookServlet" title="日志">菜谱</a></li>
<li><a href="<%=path %>/TopicServlet" title="话题">话题</a></li>
<li><a href="<%=path %>/DiaryServlet" title="日志">日志</a></li>
</ul>
</div>



<div class="wrap">
<div class="w clear">


<!-- 滚动图片   点赞次数前8的作品-->
<% ArrayList<Cook> getMostLikeCook = getMostLikeCook = (ArrayList<Cook>)request.getAttribute("getMostLikeCook");  %>

<div class="cms_index_slider mt10">
<div id="cms_index_slider">
		<% for(Cook cook:getMostLikeCook) 
		{
		%>
					<ul>
						<li>
						<a title="" href="<%=path %>/ShowPersonalCookServlet?cookId=<%=cook.getId() %>" target="_blank">
						<i><img data-src="<%=path %>/front/cookFaceImage/<%=cook.getCookPicture() %>" class="imgLoad" src="<%=path%>/front/cookFaceImage/<%=cook.getCookPicture()%>"></i>
						<div class="os"></div>
						<h4><%=cook.getCookName() %></h4>
						</a>
						</li>
					</ul>
		<%	
		}%>
</div>
</div>


<!-- 标题栏 -->
<div class="space_left">
<input type="hidden" id="cms_channel" value="9">
<div id="zhen_info">
<div id="zhen_title_wrap">
<div class="ui_title">
<div class="ui_title_wrap clear">
<h3 class="on"><a order="hot" data="0" page="2" href="<%=path%>/DiaryServlet">全部日志</a></h3>
<h3 ><a id="newDiary" order="new" data="0" page="2" href="javascript:" >最新发布</a></h3>


<script type="text/javascript">
$(function(){
	$("#newDiary").click(function(){
		$("#pagerxx").html("");
		$.ajax({
		url:"<%=path%>/DiaryServlet",
		type:"post",
		async:false,
		data:{action:"newDiary"},
		success:function(mes){
			$("#cms_list_living").html(mes);			
		}
		});//ajax结束
	});//点击事件结束	
})
</script>
</div>
</div>
</div>
</div>


<!-- -----------------------------------------------分页内容-------------------------------------------------- -->

<div class="cms_list clear" id="cms_list_living">
<ul class="on">

						<% ArrayList<Diary> getAllDiary = (ArrayList<Diary>)request.getAttribute("getAllDiary");%>
							<% for(Diary diary:getAllDiary)
							{
							%>
								<li class="nopic">
									
										<div class="detail">
											<h4> <a title="" target="_blank" href="<%=path%>/DiaryServlet?action=showDiary&diaryId=<%=diary.getId()%>"><%=diary.getDiaryName() %></a> </h4>
											<p class="substatus"><% SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
				      						 String time = format.format(diary.getPublishTime()); %> 
		      								 <%=time %>
				</p>
											<p class="subcontent"><%=diary.getDiaryContext() %></p>
										</div>
								</li>
							<% 	
							} 
							%>
</ul>
</div>

<!-- ----------------------------------------------侧边栏------------------------------------------------------------------------------ -->

<!-- 获得点赞前6 的日志信息 -->
<div class="mt30 clear" id="div-gpt-ad">
</div>
</div>
<div class="space_right">
<div class="ui_title mt20">
<div class="ui_title_wrap">
<h2 class="on">热门排行</h2>
</div>
</div>
			<%  ArrayList<Diary> getMostLikeDiary = (ArrayList<Diary>)request.getAttribute("getMostLikeDiary"); %>
			<%for(Diary diary:getMostLikeDiary)
			{
			%>
				<div class="tuijian">
				<p><a title="" href="<%=path %>/DiaryServlet?action=showDiary&diaryId=<%=diary.getId()%>" target="_blank"><%=diary.getDiaryName() %></a></p>
				</div>
				
			<% 				
			}
			%>		
</div>
</div>
</div>


<!-- -------------------------------------------------页数-------------------------------------------------------- -->
				<div class="ui-page mt20"  id="pagerpager">
				<div class="ui-page-inner" id="pagerxx">	
					<%	String context = request.getParameter("context");
					context = context==null?"":context;  %>
					<% Pager pager = (Pager)request.getAttribute("pager"); %>
					<a href="<%=path%>/DiaryServlet?context=<%=context%>&action=getAllDiary&pageNo=<%=pager.getPageNo()-1%>">上一页</a>
				
					<% for(int i =1;i<=pager.getPageCount();i++)
					{
					%>	
							<a class="no<%=i%>" href="<%=path%>/DiaryServlet?context=<%=context%>&action=getAllDiary&pageNo=<%=i%>"><%=i%></a>
					<%
					}
					%>
				
						<a href="<%=path%>/DiaryServlet?context=<%=context%>&action=getAllDiary&pageNo=<%=pager.getPageNo()+1%>">下一页</a>	
				</div>
<script type="text/javascript">
	$(function(){
		$(".no<%=pager.getPageNo()%>").css("color","red");
	})
</script>


</div>





	<!---------------------------------------------------------- 尾----------------------------------------- -->

<div style="clear:both;">
<jsp:include page="/front/footer.jsp"></jsp:include>
</div>



<script type="text/javascript" src="//static.meishichina.com/v6/js/lib/all.js?v1=20180922"></script>
<script type="text/javascript"> 
msc.goTop.init();
msc.user.init();
$("img.imgLoad").imgLoad();
//搜索不动
$("#search").click(function(){var q=$("#q").val().replace(/\s+/g,"").replace("　","");window.location.href='//home.meishichina.com/search/'+(q==""?'':q+'/')});$("#q").keydown(function(e){if(e.keyCode==13)$("#search").click()});
</script>
<script type="text/javascript" src="//static.meishichina.com/v6/js/lib/article_navlist.js?v1=2"></script>
<script src="//static.meishichina.com/res/web/scripts/slider2.js" type="text/javascript"></script>
<script type="text/javascript">

var sudoSlider = $("#cms_index_slider").sudoSlider({speed:600,slideCount:3,movecount:3,prevHtml:'<a class="prevBtn" href="javascript:void(0);"><i>&nbsp;</i></a>',nextHtml:'<a class="nextBtn" href="javascript:void(0);"><i>&nbsp;</i></a>',continuous: true});



$("#cms_index_slider li a").hover(function(){
		$(this).find("div").hide();
		$(this).find("p").fadeOut('600');
		},function(){
		$(this).find("div").show();
		$(this).find("p").fadeIn('600');
		}
		);

$(window).scroll(function() {
		var omng = $('#zhen_title_wrap').offset();
		var jtl = $('.space_left').offset();



		if (omng.top < $(document).scrollTop() + 40) {
		$('#zhen_title_wrap').css({
position: 'fixed',
top:40,
'z-index':1111,
left:omng.left
})
		} else if (omng.top < jtl.top + 20  ) {
		$("#zhen_title_wrap").css({
position: 'static' 
})
		}


var omng2 = $(".keyshow").eq(0).offset();
var jtl2 = $(".smnbk").eq(0).offset();
if(omng2&&jtl2){	
		if (omng2.top < $(document).scrollTop() + 40) {
			$(".keyshow").css({
				position: "fixed",
				top: 40,
				margin: 0,
				left: omng2.left
			});
		} else if (omng2.top < jtl2.top + 370) {
			$(".keyshow").css({
				position: "static",
				margin: "20px 0 0 0"
			});
		}


}

		});


$("#zhen_title_wrap a").click(function(){
		if($(this).parent().hasClass('on'))
		return false;
		else{
		$("#zhen_title_wrap h3").removeClass('on');
		$(this).parent().addClass('on');
		$("#cms_list_living ul").removeClass('on').hide();
		$("#cms_list_living ul:eq("+$(this).parent().index()+")").fadeIn().addClass("on");
		}
		});
</script>
<script>
$("li.top_bar_more").hoverDelay(function(){$("li.top_bar_more div").show()},function(){$("li.top_bar_more div").hide()},200,200);var _hmt=_hmt||[];(function(){var hm=document.createElement("script");hm.src="//hm.baidu.com/hm.js?fb9cd9dcdda23cee0c7357db9be24acb";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm,s)})();
(function(){var bp=document.createElement("script");var curProtocol=window.location.protocol.split(":")[0];if(curProtocol==="https"){bp.src="https://zz.bdstatic.com/linksubmit/push.js"}else{bp.src="http://push.zhanzhang.baidu.com/push.js"}var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(bp,s)})();
</script> 



</body>
</html>